#pragma once
#include <span>

template <typename T>
void shellSort(std::span<T> container) {
	auto len = container.size();

	auto gap = len / 2;

	while (gap >= 1) {
		for (auto i = gap; i < len; i++) {
			T insertValue = container[i];

			auto j = i;
			while (j >= gap && insertValue < container[j - gap]) {
				j -= gap;
				container[j + gap] = container[j];
			}

			container[j] = insertValue;
		}

		gap /= 2;
	}
}
